/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package bo;

import dto.DTO_SanPham;
import java.util.ArrayList;
import mapper.MAP_SanPham;

/**
 *
 * @author BarcelonaFC
 */
public class BUS_SanPham {
     public ArrayList<DTO_SanPham> dsLoaiSanPham(int ID,int gt)throws Exception {

       MAP_SanPham spMap = null;
       try{
           spMap = new MAP_SanPham();
           return spMap.dsLoaiSanPham(ID,gt);
       }
       catch(Exception e)
       {
           throw e;
       }


    }
    public ArrayList<DTO_SanPham> dsChuDeSP(int ID) throws Exception
    {
        MAP_SanPham spMap = null;
        try
        {
            spMap = new MAP_SanPham();
            return spMap.dsChuDeSP(ID);
        }
        catch(Exception e)
        {
            throw e;

        }

    }
    public DTO_SanPham LayThongTinSanPham(int MaSP)
    {
        MAP_SanPham mapSP = new MAP_SanPham();
        return mapSP.LayThongTinSanPham(MaSP);
    }
    public ArrayList<DTO_SanPham> LoadDSSPTheoMaSP(int masp)
    {
        MAP_SanPham mapSP = new MAP_SanPham();
        return mapSP.LoadDSSPTheoMaSP(masp);
    }
    public ArrayList<DTO_SanPham> LoadDSSPTheoTenSP(String tensp)
    {
        MAP_SanPham mapSP = new MAP_SanPham();
        return mapSP.LoadDSSPTheoTenSP(tensp);
    }
    public ArrayList<DTO_SanPham> LoadDSSP()
    {
         MAP_SanPham mapSP = new MAP_SanPham();
         return mapSP.LoadDSSP();
    }
       public boolean suasanpham(DTO_SanPham sp)
    {
        MAP_SanPham msp = new MAP_SanPham();
        return(msp.suasanpham(sp));
    }
    public boolean themsanpham(DTO_SanPham sp)
    {
        MAP_SanPham msp = new MAP_SanPham();
        return(msp.themsanpham(sp));
    }
     public boolean xoasanpham(int masp)
    {
        MAP_SanPham msp = new MAP_SanPham();
        return(msp.xoasanpham(masp));
    }
}
